package com.example.demo.concurrent.MyThreadPool2;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created with IntelliJ IDEA.
 * Description: 固定大小线程池
 * User: sfx
 * Date: 2023-03-27
 * Time: 17:34
 */
@Slf4j(topic = "c.TestDemo1")
public class TestDemo1 {
    public static void main(String[] args) {
        ExecutorService service = Executors.newSingleThreadExecutor();
        service.execute(()->{
            int x = 1/0;
            log.debug("1");
        });
        service.execute(()->{
            log.debug("2");
        });
        service.execute(()->{
            log.debug("3");
        });
    }

}


